package com.css.util;

import cn.hutool.core.convert.Convert;

/**
 * @author Dbj
 * @date 2024年09月12日  20:34
 * 烈度值转数字大写
 */
public class IntensityUtil {
    public static String getUpperNum(String num) {
        String result = "";
        if(num.length()==1){
            result = Convert.numberToChinese(Integer.parseInt(num), false);
        }if(num.length()==2){
            char[] ch = num.toCharArray();
            char a = ch[0];
            if(a=='1'){
                result+= "十";
            }
            int b = (int)ch[1]-48;
            if(b>0){
                result+= Convert.numberToChinese(b, false);
            }
        }
        return result;
    }
}
